<link type="text/css" href="/topjui/css/myui.css" rel="stylesheet"/>
<form id="search_form" method="post" style="padding-top:1px">
    <input type="hidden" name="del" value="0">
    <table class="editTable">
        <tr>
            <td class="label">合同编号</td>
            <td>
                <input type="text" name="code"  class="inputp" autocomplete="off" data-options="required:false" style="width: 190px;">
            </td>
        </tr>
        <tr>
            <td class="label">合同名称</td>
            <td>
                <input type="text" name="name"  class="inputp" autocomplete="off" data-options="required:false" style="width: 190px;">
            </td>
        </tr>
        <tr>
            <td class="label">合同金额</td>
            <td>
                <input id="form-total" name="total" class="inputp" autocomplete="off" data-options="required:false" style="width: 190px;">
            </td>
        </tr>
        <tr>
            <td class="label">合同状态</td>
            <td>
                <input id="f-status" name="status" type="hidden">
                <input id="form-status" name="fstatus" style="width: 220px" class="selectp">
            </td>
        </tr>
        <tr>
            <td class="label">签订月份</td>
            <td>
                <input id="f-crtime" name="crtime" type="hidden">
                <input id="form-crtime" name="fcrtime" style="width: 220px" class="selectp">
            </td>
        </tr>
        <tr>
            <td class="label">合同类型</td>
            <td>
                <input id="f-type" name="type" type="hidden">
                <input id="form-type" name="ftype" style="width: 220px" class="selectp">
            </td>
        </tr>
        <tr>
            <td class="label">销售领域</td>
            <td>
                <input id="f-introtype" name="introtype" type="hidden">
                <input id="form-introtype" name="fintrotype" style="width: 220px" class="selectp">
            </td>
        </tr>
        <tr>
            <td class="label">销售人员</td>
            <td>
                <input type="hidden" class="easyui-validatebox" data-options="required:true" id="form-signmanid" name="signmanid" >
                <input type="text" id="form-signman" name="signman"  class="inputp" data-options="required:false" style="width: 211px;">
            </td>
        </tr>
    </table>
</form>
<script type="text/javascript">
    $(function () {

        $('#form-signman').combotree({
            width: 220,
            height: 32,
            style: "width:220px;height:32px;",
            cls: 'selectp',
            panelWidth: 220,
            hasDownArrow: true,
            url: '/user/xs',
            onSelect: function (data) {
                $("#form-signmanid").val(data.id);
            },
            onChange:function (newValue,oldValue) {
                $("input[name=signman]").each(function(i){
                    if(i==0){

                    }else if(i==1){
                        $(this).remove();
                    }
                });
            }
        });

        $('#form-status').combotree({
            width: 220,
            height: 32,
            style: "width:220px;height:32px;",
            cls: 'selectp',
            panelWidth: 220,
            hasDownArrow: true,
            url: '/sys/groupsText?groups=合同状态',
            onSelect: function (data) {
                $("#f-status").val(data.text);
            }
        });

        $('#form-type').combotree({
            width: 220,
            height: 32,
            style: "width:220px;height:32px;",
            cls: 'selectp',
            panelWidth: 220,
            hasDownArrow: true,
            url: '/sys/groupsText?groups=合同类型',
            onSelect: function (data) {
                $("#f-type").val(data.text);
            }
        });

        $('#form-crtime').datebox({
            width: 220,
            height: 32,
            formatter: formatter_ym,
            parser: parser_ym,
            onSelect: function(date){
                var y = date.getFullYear();
                var m = date.getMonth() + 1;
                //var d = date.getDate();
                var result = y + '-' + (m < 10 ? ('0' + m) : m);
                $("#f-crtime").val(result);
                return result;
            }
        });

        $('#form-introtype').combotree({
            width: 220,
            height: 32,
            style: "width:220px;height:32px;",
            cls: 'selectp',
            panelWidth: 220,
            hasDownArrow: true,
            url: '/sys/groupsText?groups=行业分类',
            onSelect: function (data) {
                $("#f-protocol").val(data.text);
            }
        });

        $(".combo-text").removeAttr("style");
        $(".combo-text").attr("style", "width: 220px;height: 32px;;line-height:32px");
        $(".combo-text").addClass("selectp");
        $(".combo-arrow").attr("style", "margin-left: -20px;margin-top: 8px;background-color:rgba(0,0,0,0)");
        $(".combo-panel").attr("style", "margin-top:10px;");
    })

</script>